package com.sky.mapper;

import ch.qos.logback.core.rolling.helper.IntegerTokenConverter;
import com.sky.entity.Orders;
import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {

    @Select("select * from user where openid = #{openid};")
    User getByOpenId(String openid);

    /**
     * 注册新用户
     * @param user
     */
    void insert(User user);

    /**
     * 根据userId查询用户信息
     * @param userId
     * @return
     */
    @Select("select * from user where id = #{userId};")
    User getById(Long userId);

    /**
     * 查询用户数量 报表
     * @param map
     * @return
     */
    Integer countByMap(Map map);
}
